<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>活动</title>
    
    <link rel="stylesheet" type="text/css" href="__CSS__api.css"/>
    <link rel="stylesheet" type="text/css" href="__CSS__aui.css"/>
    <link rel="stylesheet" type="text/css" href="__CSS__dropload.css"/>

    <style>
        /*content*/
        html body {
            padding-top: 0.5rem;
        }

        .activity {
            padding: 0 0.7rem;
            background: #fff;
        }

        .activityImg {
            width: 4.825rem;
            height: 4.825rem;
            border-radius: 0.3rem;
            margin-right: 0.8rem;
        }

        .showImg {
            width: 100%;
            height: 100%;
        }

        .activityContent {
            display: flex;
            flex-flow: column;
            justify-content: space-between;
            height: 4.825rem;
            position: relative;
        }

        .activityTitle {
            color: #333;
            font-size: 0.8rem;
            margin-bottom: 0.2rem;
        }

        .box {
            margin-bottom: 0.25rem;
            display: flex;
            align-items: center;
        }

        .destination,
        .activityTime {
            color: #999;
            font-size: 0.65rem;
        }

        .logo1 {
            width: 0.65rem;
            height: 0.65rem;
            background: url('__IMG__location.png') no-repeat center center;
            background-size: 100% 100%;
            margin-right: 0.2rem;
        }

        .logo2 {
            width: 0.65rem;
            height: 0.65rem;
            background: url('__IMG__clock.png') no-repeat center center;
            background-size: 100% 100%;
            margin-right: 0.2rem;
        }

        .report {
            padding-top: 0.5rem;
            width: 100%;
            position: absolute;
            bottom: 0;
        }

        .signUp {
            text-align: right;
            font-size: 0.65rem;
            color: #FFBA71;
            padding-top: 25px;
        }

        .signUp1 {
            text-align: right;
            font-size: 0.65rem;
            color: #24A8FC;
            padding-top: 1.25rem;
        }

        .signUp2 {
            text-align: right;
            font-size: 0.65rem;
            color: #999;
            padding-top: 1.25rem;
        }

        .xian {
            width: 0.75rem;
            height: 0.75rem;
            display: inline-block;
            vertical-align: middle;
        }

        .moreActivity {
            width: 100%;
            height: 2.7rem;
            line-height: 2.7rem;
            color: #999;
            font-size: 0.7rem;
            text-align: center;
        }

        .juli {
            margin-bottom: 0.5rem;
        }

        .activityDetails {
            padding: 0.75rem 0 0.75rem 0;
        }

        .jiangzuo {
            position: relative;
            color: #ccc;
            font-size: 0.5rem;
            padding: 0.15rem 0.25rem;
            padding-bottom: 0.05rem;
            max-width: 5rem;
            height: 1rem;
            /*display: inline-block;*/
            float: left;
            margin-top: 1.1rem;
            margin-right: 2px;
        }

        .jiangzuo:after {
            width: 200%;
            height: 190%;
            position: absolute;
            top: -50%;
            left: -50%;
            transform-origin: 50% 50%;
            content: "";
            border: 1px solid #E6E6E6;
            border-radius: 0.4rem;
            -ms-transform: scale(0.5);
            /* IE 9 */
            -moz-transform: scale(0.5);
            /* Firefox */
            -webkit-transform: scale(0.5);
            -o-transform: scale(0.5);
            transform: scale(0.5);
            display: -webkit-box;
            overflow: hidden;
            text-overflow: ellipsis;
            word-wrap: break-word;
            word-break: break-all;
            white-space: normal !important;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
        }

        /*footer*/
        .foott {
            font-size: 0.75rem;
            color: #ccc;
            line-height: 0.75rem;
            margin: 1.15rem auto;
            text-align: center;
        }

        /*tab切换*/

        .tab-grid {
            width: 100%;
            height: 2.25rem;
            overflow-x: scroll;
            overflow-y: hidden;
            background-color: white;
            position: relative;
        }

        /*控制滚动条*/

        .tab-grid::-webkit-scrollbar {
            height: 0;
        }

        .tab-item {
            float: left;
            height: 2.25rem;
            /*margin-right: 0.25rem;*/
            padding-left: 0.75rem;
            padding-right: 0.75rem;
            line-height: 2.25rem;
            text-align: center;
            font-size: 0.75rem;
            color: #333;
        }

        .tab-item-all {
            width: 10000%;
            padding-left: 0.15rem;
        }

        .item_active {
            font-weight: bold;
            color: #E73C5C;
            font-size: 0.75rem;
            background-size: 100% 2px;
            background-repeat: no-repeat;
            background-position: bottom;
            background-image: linear-gradient(to right, transparent 40%, #E73C5C 40%, #E73C5C 60%, transparent 60%, transparent 100%);
            background-image: -webkit-linear-gradient(to right, transparent 20%, #E73C5C 20%, #E73C5C 80%, transparent 80%, transparent 100%);
        }

        .aui-bar-nav .aui-iconfont {
            position: relative;
            font-family: "aui_iconfont" !important;
            font-size: 0.75rem;
            color: #E73C5C;
            font-style: normal;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            height: 2.4rem;
        }

        .aui-bar-nav {
            background-color: #fff;
        }

        .aui-icon-tu {
            height: 2.4rem;
            width: 49px;
            background: url('__IMG__left.png') no-repeat 0.5rem center;
            background-size: 22px 22px;
        }

        .aui-bar-nav .aui-title {
            font-size: 0.9rem;
            color: #333333;
            font-weight: 500;
        }

        .aui-icon-rightu {
            height: 2.4rem;
            width: 49px;
            background: url('__IMG__search.png') no-repeat 0.6rem center;
            background-size: 22px 22px;
        }
    </style>
</head>
<body>
<header class="aui-bar aui-bar-nav underLine" style="padding-top:25px;" id="header">
    <input type="hidden" name="id" value="{$type_id}">
    <a class="aui-pull-left" tapmode="active" onclick="goindex()"> <span class="aui-iconfont aui-icon-tu"> </span>
    </a>
    <div class="aui-title">活动</div>
    <a class="aui-pull-right">
        <span class="aui-iconfont aui-icon-rightu" tapmode="active" onclick="right()"></span>
    </a>
</header>
<!--tab切换-->
<section class="tab-grid" id='tab'>
    <div class="tab-item-all" id="list">
        <div class="tab-item {if 1==$type_id}  item_active {/if}" id="tab1" onclick="tab_activity(this)" idd="1">热门活动
        </div>
    </div>
    <!-- <div class="tab-grid-right"></div> -->
    <div class="tab-item-all" id="list">
        {volist name="res" id="vo"}
        <div class="tab-item {if $vo['id']==$type_id}  item_active {/if}" id="tab{$vo.id}" onclick="tab_activity(this)"
             idd="{$vo.id}">{$vo.activity_name}
        </div>
        {/volist}
    </div>
</section>
<div class="activity">
    <div class="upOrDown">
        <div class="upOrDown_data">
            {volist name='list' id="vv"}
            <div class="activityDetails flex-wrap underLine2" onclick="fnActive(this)" idd="{$vv.id}" tapmode='acdtive'>
                <div class="activityImg">
                    {if $vv['activity_img'] != 1 }
                    <img src="{$vv.activity_img}" class="showImg">
                    {else /}
                    <img src="__IMG__kecheng.png" class="showImg">
                    {/if}
                </div>
                <div class="activityContent flex-con">
                    <div>
                        <div class="activityTitle aui-ellipsis-1">{$vv.activity_name}</div>
                        <div class="box" style="padding-top: 1px">
                            <div class="logo1"></div>
                            <div class="destination aui-ellipsis-1">{$vv.activity_address}</div>
                        </div>
                        <div class="box">
                            <div class="logo2"></div>
                            <div class="activityTime">{$vv.activity_start_time}至{$vv.activity_end_time}</div>
                        </div>
                    </div>
                    <div></div>
                    <div class="report flex-wrap">
                        <div class="jiangzuo">{$vv.activity_names}</div>
                        {if $vv.activity_status==1}
                        <div class="signUp2 flex-con">
                            报名未开始
                        </div>
                        {elseif $vv.activity_status==2 /}
                        <div class="signUp flex-con">
                            <img src="__IMG__xian.png" alt="" class="xian">报名中
                        </div>
                        {elseif $vv.activity_status==3 /}
                        <div class="signUp1 flex-con">
                            <img src="__IMG__main1_jin.png" alt="" class="xian">进行中
                        </div>
                        {elseif $vv.activity_status==4 /}
                        <div class="signUp2 flex-con">
                            已结束
                        </div>
                        {elseif $vv.activity_status==5 /}
                        <div class="signUp2 flex-con">
                            未开始
                        </div>
                        {/if}
                    </div>
                </div>
            </div>
            {/volist}
        </div>
    </div>
</div>
<!--<div class="foott">到底了～</div>-->
</body>
<script type="text/javascript" src="__JS__jquery.min.js"></script>

<script type="text/javascript" src="__JS__dropload.min.js"></script>
<script type="text/javascript" src="__JS__api.js"></script>
<script type="text/javascript" src="__JS__tt.js"></script>
<script type="text/javascript">
    window.onload=function () {
        $api.dom(".tab-item.item_active").scrollIntoView();
    }
    function tab_activity(el) {
        var idd = $api.attr(el, 'idd');
        location.href = '{:url("First/activity")}?id=' + idd;
    }
    function right() {
        location.href = '{:url("First/searchAct")}?type=1';
    }
    function goindex() {
        location.href = '{:url("First/index")}';

    }
    // 活动详情
    function fnActive(el) {
        var idd = $api.attr(el, 'idd')
        location.href = '{:url("First/activitydatail")}?activity_id=' + idd;
    }
</script>
<script>
    var page = 1;
    /**
     * 上拉加载，下拉刷新
     */
    var dropload = $('.upOrDown').dropload({
        scrollArea: window,
        autoLoad: true,
//        domUp : {
//            domClass   : 'dropload-up',
//            domRefresh : '<div class="dropload-refresh">↓下拉刷新-自定义内容</div>',
//            domUpdate  : '<div class="dropload-update">↑释放更新-自定义内容</div>',
//            domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中-自定义内容...</div>'
//        },
//        domDown : {
//            domClass   : 'dropload-down',
//            domRefresh : '<div class="dropload-refresh">刷新</div>',
//            domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
//            domNoData  : '<div class="dropload-noData">无数据</div>'
//        },
        loadDownFn: function (me) {
            var id = $('input[name="id"]').val();
            page++;
            $.ajax({
                url: '{:url("First/ajaxactivitylist")}',
                data: 'page=' + page + '&id=' + id,//
                type: 'POST',
                dataType: 'JSON',
                success: function (data) {
                    var arrLen = data.msg.length;
                    if (arrLen <= 0) {

                        me.lock();
//                         无数据
                        me.noData(true);
                        // 每次数据加载完，必须重置
                        me.resetload();
                    } else {
                        var datas = data.msg;
                        $.each(datas, function (key, v) {
                            var _html = '';
                            _html += '<div class="activityDetails flex-wrap underLine2 cooc" id="' + v.id + '" tapmode="acdtive">';
                            _html += '<div class="activityImg">';
                              if(v.activity_img!= 1){
                                 _html +='<img src="' + v.activity_img + '" class="showImg">';
                              }else{
                             _html +='<img src="__IMG__kecheng.png" class="showImg">';
                              }

                            _html +='</div>';
                            _html += '<div class="activityContent flex-con"><div>';
                            _html += '<div class="activityTitle aui-ellipsis-1">' + v.activity_name + '</div>';
                            _html += '<div class="box"  style="padding-top: 1px">';
                            _html += '<div class="logo1"></div>';
                            _html += '<div class="destination aui-ellipsis-1">' + v.activity_address + '</div></div>';
                            _html += '<div class="box"> <div class="logo2"></div>';
                            _html += '<div class="activityTime">' + v.activity_start_time + '至' + v.activity_end_time + '</div></div></div>';

                            _html += '<div></div><div class="report flex-wrap">';
                            _html += '<div class="jiangzuo">' + v.activity_names + '</div>';
                            if (v.activity_status == 1) {
                                _html += '<div class="signUp2 flex-con">';
                                _html += '报名未开始</div> </div> </div> </div>';
                            } else if (v.activity_status == 2) {
                                _html += '<div class="signUp flex-con">';
                                _html += '<img src="__IMG__xian.png" alt="" class="xian">报名中</div> </div> </div> </div>';
                            } else if (v.activity_status == 3) {
                                _html += '<div class="signUp1 flex-con">';
                                _html += '<img src="__IMG__main1_jin.png" alt="" class="xian">进行中</div> </div> </div> </div>';
                            } else if (v.activity_status == 4) {
                                _html += '<div class="signUp2 flex-con">';
                                _html += '已结束</div> </div> </div> </div>';
                            } else if (v.activity_status == 5) {
                                _html += '<div class="signUp2 flex-con">';
                                _html += ' 未开始</div> </div> </div> </div>';
                            }
                            $(".upOrDown_data").append(_html);

                        });
//                        $('.upOrDown_data').append(data);
                        // 每次数据加载完，必须重置
                        me.resetload();
                    }
                    $('.cooc').click(function () {
                        var id = $(this).attr('id');
                        location.href = '{:url("First/activitydatail")}?activity_id=' + id;
                    });
                },
                error: function (xhr, type) {
                    alert('Ajax error!');
                    // 即使加载出错，也得重置
                    me.resetload();
                }
            });
        },
        loadUpFn: function (me) {
            var id = $('input[name="id"]').val();

            page = 1;
            $.ajax({
                url: '{:url("First/ajaxactivitylist")}',
                data: 'page=' + page + '&id=' + id,
                type: 'POST',
                dataType: 'json',
                success: function (data) {
                    $('.upOrDown_data').empty();//
                    var datas = data.msg;
                    $.each(datas, function (key, v) {
                        var _html = '';

                        _html += '<div class="activityDetails flex-wrap underLine2 cooc" id="' + v.id + '" tapmode="acdtive">';
                        _html += '<div class="activityImg">';

                        if(v.activity_img!= 1 ){
                            _html +='<img src="' + v.activity_img + '" class="showImg">';
                        }else{
                            _html +='<img src="__IMG__kecheng.png" class="showImg">';
                        }

                        _html +='</div>';
                        _html += '<div class="activityContent flex-con"><div>';
                        _html += '<div class="activityTitle aui-ellipsis-1">' + v.activity_name + '</div>';
                        _html += '<div class="box" style="padding-top: 1px">';
                        _html += '<div class="logo1"></div>';
                        _html += '<div class="destination aui-ellipsis-1">' + v.activity_address + '</div></div>';
                        _html += '<div class="box"> <div class="logo2"></div>';
                        _html += '<div class="activityTime">' + v.activity_start_time + '至' + v.activity_end_time + '</div></div></div>';

                        _html += '<div></div><div class="report flex-wrap">';
                        _html += '<div class="jiangzuo">' + v.activity_names + '</div>';
                        if (v.activity_status == 1) {
                            _html += '<div class="signUp2 flex-con">';
                            _html += '报名未开始</div> </div> </div> </div>';
                        } else if (v.activity_status == 2) {
                            _html += '<div class="signUp flex-con">';
                            _html += '<img src="__IMG__xian.png" alt="" class="xian">报名中</div> </div> </div> </div>';
                        } else if (v.activity_status == 3) {
                            _html += '<div class="signUp1 flex-con">';
                            _html += '<img src="__IMG__main1_jin.png" alt="" class="xian">进行中</div> </div> </div> </div>';
                        } else if (v.activity_status == 4) {
                            _html += '<div class="signUp2 flex-con">';
                            _html += '已结束</div> </div> </div> </div>';
                        } else if (v.activity_status == 5) {
                            _html += '<div class="signUp2 flex-con">';
                            _html += ' 未开始</div> </div> </div> </div>';
                        }
                        $(".upOrDown_data").append(_html);
                    });
                    me.resetload();
                    me.unlock();
                    me.noData(false);
                    $('.cooc').click(function () {
                        var id = $(this).attr('id');
                        location.href = '{:url("First/activitydatail")}?activity_id=' + id;
                    });
                },
                error: function (xhr, type) {
                    alert('Ajax error!');
                    me.resetload();
                }
            });
        }
    });
</script>
</html>
